package priv.ln.method_more.exer1;

/**
 * ClassName: exer1
 * Package: priv.ln.method_more.exer1
 * Description:
 *n个字符串进行拼接，每一个字符串之间使用某字符进行分割，如果没有传入字符串，那么返回空字符串""
 * @Author 辣辣
 * @Create 2024/6/20 16:56
 * @Version 1.0
 */
public class exer1 {
    public String stringConcat(String operator,String ... str){
        String result="";
        for(int i = 0;i < str.length;i++){
            if(i == 0){
                result += str[i];
            }else {
                result += (operator + str[i]);
            }
        }

        return result;
    }
}
